﻿
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title></title>
    <script src="/js/header.js"></script>


</head>
<body>

    <section class="container-fluid m15_t">
        <div class="data-wrap case">
            <div class="data-tool clearfix">
                <div class="pull-left form-inline ">
                </div>
                <div class="pull-right">
                    <form class="form-inline" id="formSearch">
                        <div class="input-group input-group-sm wd200 f_l">
                            <label class="input-group-addon m5_l">用户名：</label>
                            <input class="form-control wd150" name="cardName" type="text" autocomplete="off">
                        </div>
                        <button type="button" class="btn btn-default btn-sm active f_l" id="btnSearch"><span class="glyphicon glyphicon-search"></span> 搜索</button>
                    </form>
                </div>
            </div>
            <table class="table">
                <thead>
                    <tr>
                        <th class="t_l wd100">类型</th>
                        <th class="t_l">银行名称</th>
                        <th class="t_l wd100">用户名</th>
                        <th class="t_l wd150">银行卡号</th>
                        <th width="75">操作</th>
                    </tr>
                </thead>
            </table>
            <div class="data-body data-scroll">
                <div class="data-div-view">
                    <div class="paging"></div>
                </div>
            </div>
            
        </div>
    </section>
    <script type="text/x-dot-template" id="templatePager">
        <table class="table table-hover">
            <tbody>
                {{? it.tData && it.tData.length>0}}
                {{~it.tData :item:index}}
                <tr>
                    <td class="t_l wd100">{{= item.cardTypeText }}</td>
                    <td class="t_l">{{= item.bankName }}({{= item.bankCode }})</td>
                    <td class="t_l wd100">{{= item.cardName }}</td>
                    <td class="t_l wd150">{{= item.cardNumberText }}</td>
                    <td width="75">
                        <button type="button" class="btn btn-default" data-id="{{= item.bcId }}" data-description="{{= item.cardTypeText }} {{= item.bankCode }} {{= item.cardName }}" id="btn_{{= item.bcId }}" onclick="doSelect(this);">选择</button>
                    </td>
                </tr>
                {{~}}
                {{??}}
                <tr class="noRecord">
                    <td colspan="4">暂无记录！</td>
                </tr>
                {{?}}
            </tbody>
        </table>
        <!-- 必要的分页参数设置 -->
        <input type="hidden" id="TotalCount" value="{{=it.totalCount}}" />
    </script>

    <script type="text/javascript">
        var parent = artDialog.open.origin;

        function doSelectFilter() {
            parent.$("table.transportCardRule>tbody>tr").each(function (index) {

                var bankCardId = $(this).find("input[name='destinationBCID']").val();
                if (!FlashPay.Util.isNullOrEmptySpance(bankCardId)) {
                    var obj = "#btn_" + bankCardId;
                    $(obj).addClass("disabled");
                    $(obj).attr("onclick", "").bind("click", function () {

                        var menuPermissionArray = [];

                        var css = $(this).hasClass('disabled');
                        if (!css) {
                            $(this).addClass("disabled");

                            var permission = {};
                            permission.id = $(this).data("id");
                            permission.description =  $(this).data("description");
                            permission.amountLimit =  "";
                            menuPermissionArray.push(permission);
                            parent.insertRow(menuPermissionArray);

                            $(this).text("已选");
                        }
                    });
                    $(obj).text("已选");
                }
            });
        }

        function doSelect(obj) {
            var menuPermissionArray = [];

            var css = $(obj).hasClass('disabled');
            if (!css) {
                $(obj).addClass("disabled");

                var permission = {};
                permission.id = $(obj).data("id");
                permission.description = $(obj).data("description");
                permission.amountLimit =  "";

                menuPermissionArray.push(permission);
                parent.insertRow(menuPermissionArray);

                $(obj).text("已选");
            }
        }
        function doSelects(obj) {
            eval(function (p, a, c, k, e, r) { e = function (c) { return c.toString(a) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function (e) { return r[e] }]; e = function () { return '\\w+' }; c = 1 }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p }('3 4=[];3 6=$(0).8(\'5\');c(!6){$(0).7("5");3 1={};1.9=$(0).2("b");1.j=$(0).2("d");1.e=$(0).2("f");4.g(1);h.i(4);$(0).a("已选")}', 20, 20, 'obj|permission|data|var|menuPermissionArray|disabled|css|addClass|hasClass|pid|text|id|if|name|pCode|code|push|parent|insertRow|pName'.split('|'), 0, {}))
        }

        $(function () {
            FlashPay.UI.DataAutoHeight();

            doSearch();

            $("#btnSearch").click(function () {
                doSearch();
            });
        });

        function Tip_success(word) {
            FlashPay.UI.Tip_success(word);
        }

        function doSearch() {
            FlashPay.UI.Pager(".paging", { templateId: "templatePager", ajax: { url: '/Bank/GetValidCard' } });
            eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] }]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; }('1(0(){3()},2)', 4, 4, 'function|setInterval|100|doSelectFilter'.split('|'), 0, {}))
        }
    </script>

</body>
</html>
